<extend name="Base/base" />
<block name='head'>
    <meta charset="utf-8">
    <link href="/Public/Index/css/workflow.css" rel="stylesheet" /> 
    <link href="/Public/Index/css/form.css" rel="stylesheet" /> 
    <!--文件上传-->
    <script type="text/javascript" src="__PUBLIC__/Cropper/js/ajaxfileupload.js" ></script>
    <style>
        .form .text_table,.table_bg{width:100%; margin: 0 auto; background: #f8f8f8;}
        .form .table_bg tr td{color:#333;border:none;border-bottom: 1px solid #efefef;} 
        .form .table_bg tr { height: 55px;}
    </style>
</block>
<block name="content" > 
    <div class="workflow">
        <div class="content">
            <form>
                <div class="form">
                    <if condition="$run_id neq null">
                        {$form.print_model}
                        <else />
                        {$form.print_model}
                    </if>
                </div>
                <div class="up" style="">
                    <div class="line">公共附件区</div>
                    <!--<div class="line pointer"><a id="upload">+ 添加附件</a></div>-->
                    <div class="line filename-cont">
                        <foreach name="uploads" item="row" key="key">
                            <span style="display:block">
                                <a href="{$row.upload}" download="{$row.name}">{$key+1}. {$row.name}</a>
                                <!--<img src="/Public/Index/img/close.png" class="pointer delfile" data-fileurl="{$row.upload}"/>-->
                            </span>
                        </foreach>
                    </div>
                    <!--                    <if condition="$upload['pcNames'][0] neq null">
                                            <div class="line">
                                                <span style="color:red;font-size:0.6em;font-weight:bold">PC端上传的文件暂不支持阅览，请在电脑上打开！</span><br/>
                                                <foreach name="upload.pcNames" item='pc'>
                                                    <span style="color:gray">{$pc}</span><br/>
                                                </foreach>
                                            </div>
                                        </if>-->
                    <input type="file" id="inputImage" name='imgfile' style="display:none">
                    <input type="hidden" id="filename" name="uploads" value="{$info.uploads}">
                    <input type="hidden" id="fileurl" name="uploads_url" value="{$info.uploads_url}">
                    <input type="hidden" name="url" value="{:U('delFile')}">
                </div>
                <!--会签意见区-->
                <if condition="$prcs neq 1">
                    <div class="feedback up"  style="">
                        <div class="line">会签意见区</div>
                        <textarea name="feedback" style="height:200px;margin-top:8px;margin-bottom:2em;margin-left:5.8%;width:87%;border-color:#efefef;"></textarea>
                    </div>
                </if>
                <input type="hidden" name="FORM_ID" value="{$form_id}">
                <input type="hidden" name="RUN_ID" value="{$run_id}">
                <input type="hidden" name="PRCS_ID" value="{$prcs}">
                <input type="hidden" name="FLOW_ID" value="{$info.flow_id|default=0}">
                <input type='hidden' name='currPrcs' value="{$currPrcs}">
                <input type="hidden" name="isEdit" value="{$info.isEdit}">
            </form>
            <div class="button"  align="center">
                <notempty name="op">
                    <a class="pointer btn-submit ajax-post" data-verify="all" data-url="{:U('form')}" data-form="">转交下一步</a>
                    <if condition="$prcs neq 1">
                        <a class="pointer back" data-verify="all" data-url="{:U('backFlow')}" data-form="" style="">回退</a>
                    </if>
                    <else />
                    <a class="pointer btn-submit ajax-post" data-verify="all" data-url="{:U('form',array('type'=>2))}" data-form="">办理完毕</a>
                    <if condition="$prcs neq 1">
                        <a class="pointer back" data-verify="all" data-url="{:U('backFlow')}" data-form="" style="">回退</a>
                    </if>
                </notempty>
                <a class="pointer btn-submit ajax-post" data-verify="all" data-url="{:U('form',array('type'=>1))}" data-form="">保存</a>
            </div>
        </div>

        <div class="button" id="button">
            <input type="hidden" id="url" value="{:U('getRunData',array('run_id'=>$run_id,'flow_id'=>$flow_id))}">
            <input type="hidden" id="feedbackUrl" value="{:U('getRunData',array('type'=>'feedback','run_id'=>$run_id))}">
            <a class="am-btn" onclick="history.go(-1)">返 回</a>
        </div>
        <input type="hidden" id="username" value="{$Think.session.user_name}">
        <input type="hidden" id="deparment" value="{$department}">
        <input type="hidden" id="formUrl" value="{:U('getFormData')}">
    </div>
</block>
<block name="script">
    <script type="text/javascript" src="/Public/Index/js/form.js"></script>
    <script type="text/javascript">
                $(function () {
                    $('.form input').val('');
                    $('.form table .text_value input,textarea,select').css({'width': '87%', 'padding': '0.3em'});
                    $('.form table .text_value input,.text_td input').removeAttr('hidden')
//            $('input').each(function(){
//                if($(this).attr('title').indexOf('时间') > 0){
//                    $(this).css({'width':'30%'})
//                }
//                if($(this).attr('title').indexOf('天数') > 0){
//                    $(this).css({'width':'20%'})
//                }
//            })
                })

                {$form.script}
                $(initUpload("{:U(CONTROLLER_NAME.'/upload')}"));
                $(dateTime(0))
                $(initFormData())
    </script>
</block>
